package com.nowoe.data.sqlSession;

import com.nowoe.data.config.Configuration;
import com.nowoe.data.exector.Executor;
import com.nowoe.data.exector.SimpleExecutor;

/**
 * @author 倚栏听风 2023/9/14 16:33
 */
public class DefaultSqlSessionFactory implements SqlSessionFactory {
    private Configuration configuration;

    public DefaultSqlSessionFactory(Configuration configuration) {
        this.configuration = configuration;
    }

    @Override
    public SqlSession openSession() {
        //创建执行器对象
        Executor executor = new SimpleExecutor();
        //创建sqlSession对象

        return new DefaultSqlSession(configuration, executor);
    }
}
